import request from '@/utils/request'
/**
 * 获取权限列表数据
 * @returns
 */
export const getPermissionListApi = () => {
  return request({
    url: '/sys/permission'
  })
}
/**
 * 删除权限功能
 * @param {*} id 权限id
 * @returns
 */
export const delPermissionApi = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
/**
 * 新增权限功能
 * @param {*} data form数据
 * @returns
 */
export const addPermissionApi = data => {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}
/**
 * 获取回显数据
 * @param {*} id 权限id
 * @returns
 */
export const getDataApi = id => {
  return request({
    url: `/sys/permission/${id}`
  })
}
/**
 * 编辑功能
 * @param {*} data 数据
 * @returns
 */
export const editPermissionApi = data => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}
